
#ifndef SPEEDMONITOR_H
#define SPEEDMONITOR_H

#include "SensorNotify.h"
#include "Setting.h"
#include <qobject.h>


#include <qstring.h>
#include <qtimer.h>
class SpeedMonitor : public SensorNotify
{

	Q_OBJECT
	signals:
		void speedSignal(const QString& str);
	public:
		SpeedMonitor(Setting* setting); 
		~SpeedMonitor(); 


		void update(const SensorState& state);
		int speed() const;


		public slots:
			void caculateSpeed();

	private:
		QTimer* m_timer;
		Setting* m_setting;
		int m_counter;
		int m_speed; //cm per second
		bool m_isFirst;
};

#endif
